<?php include _include(ADMIN_PATH.'view/htm/header.inc.htm');?>

<div class="container-fluid">
    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <div class="card-body">
                    <?php if (0 == $type || 2 == $type) { ?>
                    <div class="row">
                        <div class="col-lg-12">
                            <p class="text-center">
                                <?php echo lang('current_version').' : '.$config['version'];?>
                            </p>
                            <p class="text-center">
                                <?php echo lang('official_version').' : '.$config['official_version'];?>
                            </p>
                            <hr>
                            <?php echo array_value($official, 'message', 'Nothing message'); ?>
                            <hr>
                            <p class="text-center font-weight-bold">
                                <?php if (0 == $type) { ?>

                                <?php if (0 == $upgrade) { ?>
                                <?php echo lang('no_upgrade_required'); ?>
                                <?php } ?>

                                <?php if ($upgrade) { ?>

                                <?php if ($downzip) { ?>
                                <strong>
                                    <a class="text-danger h2" href="http://www.wellcms.cn/" target="_blank">please download the upgrade package from the official website and upgrade manually / 请到官方下载升级包，手动升级</a>
                                </strong>
                                <?php } else { ?>

                                <?php if (1 == $upgrade) { ?>
                                <button class="btn btn-danger btn-lock col-md-2 mx-auto" id="upgrade"><?php echo lang('online_upgrade');?></button>
                                <?php } ?>

                                <?php if (2 == $upgrade) { ?>
                                <strong>
                                    <a class="text-danger h2" href="http://www.wellcms.cn/" target="_blank">please download the upgrade package from the official website and upgrade manually / 请到官方下载升级包，手动升级</a>
                                </strong>
                                <?php } ?>

                                <?php } ?>
                                <?php } ?>
                                <?php } ?>

                                <?php if (2 == $type) {echo lang('upgrade_successfully');} ?>

                            </p>
                        </div>
                    </div>
                    <?php } ?>

                    <?php if (1 == $type) { ?>
                    <p class="text-center font-weight-bold">
                        <?php echo lang('upgrading'); ?>
                    </p>
                    <?php } ?>

                </div>
            </div>
        </div>
    </div>
</div>

<?php include _include(ADMIN_PATH.'view/htm/footer.inc.htm');?>

<script>
    $('#upgrade').on('click', function () {window.location = xn.url('other-upgrade', {type:1}, true);});
</script>